package com.yb.blog.domain;

import java.util.List;

public class Result {

    private String code;

    private String msg;

    private Object data;

    private List list;

    public Result() {
    }

    public static Result success(){
        Result result = new Result();
        result.setCode("0000");
        result.setMsg("成功");
        return result;
    }

    public static Result success(List list){
        Result result = success();
        result.setList(list);
        return result;
    }
    public Result(String code, String msg, Object data, List list) {
        this.code = code;
        this.msg = msg;
        this.data = data;
        this.list = list;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public List getList() {
        return list;
    }

    public void setList(List list) {
        this.list = list;
    }


    @Override
    public String toString() {
        return "Result{" +
                "code='" + code + '\'' +
                ", msg='" + msg + '\'' +
                ", data=" + data +
                ", list=" + list +
                '}';
    }
}
